package com.hsjk.szwj.module.pay.controller.app.refund.vo;

import com.hsjk.szwj.module.pay.dal.dataobject.config.AbstractResp;
import com.hsjk.szwj.module.pay.dal.dataobject.order.RefundOrderDO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author chenjiawei
 * @desc
 * @Date 2023/08/25 00:43
 **/
@Data
public class RefundOrderRespVO extends AbstractResp {
    /**
     * 支付系统退款订单号
     **/
    private Long refundOrderId;

    /**
     * 商户发起的退款订单号
     **/
    private Long mchRefundId;

    /**
     * 订单支付金额
     **/
    private Long payAmount;

    /**
     * 申请退款金额
     **/
    private Long refundAmount;

    /**
     * 退款状态
     **/
    private Integer state;

    /**
     * 渠道退款单号
     **/
    private String channelOrderNo;

    /**
     * 渠道返回错误代码
     **/
    private String errCode;

    /**
     * 渠道返回错误信息
     **/
    private String errMsg;


    public static RefundOrderRespVO buildByRefundOrder(RefundOrderDO refundOrder) {

        if (refundOrder == null) {
            return null;
        }

        RefundOrderRespVO result = new RefundOrderRespVO();
        BeanUtils.copyProperties(refundOrder, result);

        return result;
    }
}
